import { ApiProperty } from '@nestjs/swagger';
import * as dayjs from 'dayjs';
import { Live } from 'src/modules/live/entities/live.entity';
import { User } from 'src/modules/user/entities/user.entity';
import {
  Column,
  Entity,
  JoinColumn,
  ManyToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';

@Entity()
export class Movie {
  @ApiProperty({ description: 'id' })
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @ApiProperty({ description: '链接' })
  @Column({ length: 500 })
  url: string;

  // @ManyToOne(() => Live, (live) => live.id)
  // @JoinColumn()
  @ApiProperty({ description: '链接' })
  @Column({ length: 500, default: '' })
  liveId: string;

  @ApiProperty({ description: '创建时间' })
  @Column('datetime', { default: dayjs().format() })
  createAt: string;

  @ApiProperty({ description: '更新时间' })
  @Column('datetime', { default: dayjs().format() })
  updateAt: string | undefined;

  @ApiProperty({ description: '删除时间' })
  @Column('datetime', { default: dayjs().format() })
  deleteAt: string | undefined;
}
